{extend name="admin@public/base" /}
{block name="main-content"}
	<div class="page-content">
		<!--主题-->
		<div class="page-header">
			<h1>
				您当前操作
				<small>
					<i class="ace-icon fa fa-angle-double-right"></i>
					添加商品
				</small>
			</h1>
		</div>
		<div class="row">
			<div class="col-xs-12">
				<form class="form-horizontal ajaxForm2" name="form0" method="post" action="{:url('admin/Goods/goods_list_runadd')}"  enctype="multipart/form-data">
                
                     <div class="form-group">
						<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 商品名称：  </label>
						<div class="col-sm-10">
							<input type="text" name="goods_title" id="goods_title"  placeholder="必填：商品名称"  class="col-xs-10 col-sm-6" required/>
							  <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle" id="resone"></span>
											</span>
						</div>
					</div>
					<div class="space-4"></div>

					<div class="form-group">
						<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 商品分类： </label>
						<div class="col-sm-10">
							<select name="cid"  class="col-sm-3 selector" required>
								<option value="">请选择所属商品分类</option>
								{foreach name="menu" item="vo"}
									<option value="{$vo.id}" {if condition="$vo.id eq $cid"} selected {/if} {if condition="$vo.cate_type eq 1"}disabled class="bgccc"{else/}class="bgc"{/if}>{$vo.lefthtml}{$vo.cate_name}</option>
								{/foreach}
							</select>
						</div>
					</div>	
					<div class="space-4"></div>
					
					 
					
					
					<div class="form-group">
						<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 商品属性：  </label>
						<div class="checkbox">
							{foreach name='diyflag' item='diyflag'}
								<label id="news_flag_{$diyflag.diyflag_value}">
									<input class="ace ace-checkbox-2" name="goods_flag[]" type="checkbox" id="news_flag_va{$diyflag.diyflag_value}" value="{$diyflag.diyflag_value}" />
									<span class="lbl"> {$diyflag.diyflag_name}</span>
								</label>
							{/foreach}
						</div>
					</div>
					<div class="space-4"></div>
                    
                    
                    <div class="form-group">
						<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 成本价：  </label>
						<div class="col-xs-10 col-sm-1">
							<input type="number" name="price_cb" id="price_cb" placeholder="产品成本价" />
						</div>
                        
					</div>
					<div class="space-4"></div>
                    
                     <div class="form-group">
                        <label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 销售价：  </label>
						<div class="col-sm-10 col-sm-1">
							<input type="number" name="price" id="price" placeholder="销售价" />
						</div>
                        
					</div>
					<div class="space-4"></div>
                    
                    
                    
                    <script language="javascript">
                       $("#price").change(function(){
					       $(".fee_all").val($(this).val());
					   })
                    </script>
                    
                     <div class="form-group">
						<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 等级售价：  </label>
						<div class="col-xs-10">
							  <div class="row">
                              {foreach name="member_list" item="mt"}
                               <div class="col-xs-10 col-sm-1" style="margin-right:75px">
							      {$mt.name}售价：  <input type="number" class="fee_all" name="prices[{$mt.id}]" id="price_{$mt.id}" placeholder="{$mt.name}" />
						       </div>
                              {/foreach}
                           
                                  
                              </div>  
 
                             
                             
						</div>
                         
					</div>
					 <div class="form-group">
                      <label class="col-sm-2 control-label no-padding-right" for="form-field-1">&nbsp;</label>
                      <div class="col-xs-10" style="color:#F00">等级售价为不同等级下的销售价，请注意该售价不得低于成本价，若低于成本价则默认为销售价。</div>
                    </div>
                    
                    <div class="form-group">
						<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 佣金比率：  </label>
						<div class="col-sm-10  col-sm-6">
							<input type="text" name="percent" id="percent" value="{$site_bilv}"  class="col-sm-10  col-sm-6" placeholder="佣金比率设置为一级:二级:三级,三值相加不得超过100."/>
						</div>
                        
					</div>
					<div class="space-4"></div>
                    
                    <div class="form-group">
						<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 商品库存：  </label>
						<div class="col-sm-10  col-sm-1">
							<input type="number" name="count_goods" id="count_goods"  placeholder="商品库存"/>
						</div>
                       
                        <label class="col-sm-1 control-label no-padding-right" for="form-field-1"> 已售数量：  </label>
						<div class="col-sm-10  col-sm-1">
							<input type="number" name="count_already" id="count_already"  placeholder="已售数量"/>
						</div> 
					</div>
					<div class="space-4"></div>
                    
 
					<div class="form-group">
						<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 商品图片上传： </label>
						<div class="col-sm-10">
							<a href="javascript:;" class="file">
								<input type="file" name="pic_one[]" id="file0" />
								选择上传文件
							</a>
							<span class="lbl">&nbsp;&nbsp;<img src="__PUBLIC__/img/no_img.jpg" width="100" height="70" id="img0" ></span>&nbsp;&nbsp;<a href="javascript:;" onClick="return backpic('__PUBLIC__/img/no_img.jpg');" title="还原修改前的图片" class="file">
							撤销上传
						</a>
											<span class="lbl">&nbsp;&nbsp;上传前先用PS处理成等比例图片后上传，最后都统一比例<br />
</span>
						</div>
					</div>
					<div class="space-4"></div>


					<div class="form-group">
						<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 商品相册： </label>
						<div class="col-sm-10">
							<div class="radio" >
								<label>
									<input name="goods_pic_type" id="news_pic_list" checked type="radio" class="ace" value="1"/>
									<span class="lbl"> 无图模式</span>
								</label>
								<label>
									<input name="goods_pic_type" id="news_pic_qqlist" type="radio" class="ace" value="2"/>
									<span class="lbl"> 多图模式</span>
								</label>
							</div>
						</div>
					</div>
					<div class="space-4"></div>
					<!-- 多图上传 -->
					<link href="__PUBLIC__/ppy/css/fileinput.css" media="all" rel="stylesheet" type="text/css" />
                    <script src="__PUBLIC__/ppy/js/fileinput.js" type="text/javascript"></script>
                    <script src="__PUBLIC__/ppy/js/fileinput_locale_zh.js" type="text/javascript"></script>
					<div class="form-group" id="pic_list">
						<div class="col-sm-10 col-sm-offset-2" style="padding-top:5px;">
							<input id="file-5" name="pic_all[]" type="file"  class="file"  multiple data-preview-file-type="any" data-upload-url="#" data-preview-file-icon=""><br />
							<textarea name="goods_pic_content" class="col-xs-12 col-sm-12" id="goods_pic_content"  placeholder="单次编辑或添加文章,选择多图时请一次性选择。多图对应文章说明，例如： 图片一说明 | 图片二说明 | 图片三说明    每个文字说明以 | 分割" ></textarea>
						</div>
					</div>
					<div class="space-4"></div>
					<div class="form-group">
						<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 是否审核： </label>
						<div class="col-sm-10" style="padding-top:5px;">
							<input name="status" id="status" value="1" checked="checked" class="ace ace-switch ace-switch-4 btn-flat" type="checkbox" />
							<span class="lbl">&nbsp;&nbsp;默认打开</span>
						</div>
					</div>
					<div class="space-4"></div>

					<div class="form-group">
						<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 排序（从小到大）： </label>
						<div class="col-sm-10">
							<input type="text" name="listorder" value="50" class="col-xs-10 col-sm-1" />
						</div>
					</div>
					<div class="space-4"></div>

					<div class="form-group">
						<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 过期日期：  </label>
						<div class="col-sm-10">
							<input name="end_times" class="date-picker col-xs-10 col-sm-3" value="" type="text" data-date-format="yyyy-mm-dd" placeholder="不填或为0则为永久有效">
						</div>
					</div>
					<div class="space-4"></div>
					
					 
					<div class="form-group">
						<label class="col-sm-2 control-label no-padding-right" for="form-field-1"> 文章主内容 </label>
						<div class="col-sm-10">
							<script src="__PUBLIC__/ueditor/ueditor.config.js" type="text/javascript"></script>
							<script src="__PUBLIC__/ueditor/ueditor.all.js" type="text/javascript"></script>
							<textarea name="content" rows="100%" style="width:100%" id="myEditor"></textarea>
							<script type="text/javascript">
								var editor = new UE.ui.Editor();
								editor.render("myEditor");
							</script>
						</div>
					</div>
					<div class="space-4"></div>

					<div class="clearfix form-actions">
						<div class="col-md-offset-3 col-md-9">
							<input class="ace ace-checkbox-2" name="continue" type="checkbox" value="1">
							<span class="lbl"> 发布后继续</span>
							<button class="btn btn-info" type="submit">
								<i class="ace-icon fa fa-check bigger-110"></i>
								保存
							</button>

							&nbsp; &nbsp; &nbsp;
							<button class="btn" type="reset">
								<i class="ace-icon fa fa-undo bigger-110"></i>
								重置
							</button>
						</div>
					</div>
				</form>
			</div>
		</div>

	</div><!-- /.page-content -->
{/block}
{block name="scripts"}
	<script>
			//多图设置
			$("#pic_list").hide();
			$("#news_pic_list").click(function(){
				$("#pic_list").hide();
			});
			$("#news_pic_qqlist").click(function(){
				$("#pic_list").show();
			});
			//跳转额外属性
			$("#pptaddress").hide();
			$("#news_flag_vaj").click(function(){
				$("#pptaddress").toggle(400);
			});
			 
			$('.date-picker').datepicker({
					autoclose: true,
					todayHighlight: true,
					language:'zh-CN',
				})
	</script>
{/block}